package net.hserver.apm.util;


import io.github.elkan1788.ip2region.IPSearcher;

public class IpUtil {
    private static IPSearcher ipSearcher;

    public static String getIp(String ip) {
        try {
            if (ipSearcher==null) {
                ipSearcher = new IPSearcher();
            }
            return ipSearcher.memorySearch(ip).getRegion();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }
}
